Issue #177 - Fix bugs