Improved thrown errors across all files.