Merged dequis's fixes in to PR-272