Merged changes from fhemberger