Various bug fixes for last push