cleanup of dtype handling, exceptions