Fixed bugs introduced in previous bug fixes