Kngine: Add additional error checking.