Fixes #26; Some additional cleanup