Code cleanup

Little fixes relevant to #3