Additions and bug fixes

Additions and bug fixes