Critical bug fixes