Fixed error functionality.