Some fixes. Already functional.