First swing at fixing #277