support for type alias + some small bug fixes