fixing placement of fixes from a9f3851
applying changes from c6c74a9 to build