Added better error message handling and fixed jQuery animations.