ENH: Minor fixes and runtime checks