Bug fixes and amends