Beautify error messages
Implement some missing functions