Some cleanup for issues/1082
Merge pull request #1088 from monkeyiq/2013jan/issue1082cleanup

Some cleanup for issues/1082