Tweak gitignore; fix up functions