Merged changes from @tchule