Fix bugs

fix #2
refs #1