Fix some errors, add entrypoint