Fixing major bug with David's changes

Self explanatory.