Fixing bus configuration, adding a lot of error handling, adding test