Merged kcuzner's changes