Bug Fixes #76 #77 #78 #161 Implementation of #161