A few final bug fixes until merge