Merges changes from Mehdi Gholam (mgholam@hotmail.com)