Some panic bug fixes