Varioius fixes to simplify usage of the library