addressed Sattam's comments, and fixed bugs introduced by the previous fix
3 files changed