fixed some variables that were being set incorrectly.