Simpler cast, more checking.