Still debugging, no idea why this error is occuring. This needs to be
fixed before I can use this in a production environment.