Improve error handling and docker types