Various improvements

/cc @benkirzhner @proby @koos42