Fixed unclosed functions.

Progress towards #2.