More error handling in bar functions.