Bug Fixes

General fixes