Bug fixes

should test before commiting