A few more bug fixes