Bug fixes + small improvements