The first problem was dumb on my part...
I had /home/www symlinked to /mnt/card/www
and had my SD inserted (I forgot that I had
created the symlinks.)
The script works as expected with regards
to the first problem.
I still need to fix my sed commands, though.