pull latest changes from maxwen @24-May-2013