Adding changes from #537

#537