Merge and bug fix Habib's changes

http://jira.webinos.org/browse/WP-1319