fixes #654, #574, #655