Imported all changes from the Squeeze Version