Fixes several errors. Works.