Added ability to register an error frame callback. Closes #13.