Additions and bug fixes