Bug Fixes

Various fixes