Added error logging to cast methods