Fixed up various parts of the code.

Signed-off-by: wpenson <wade7368@gmail.com>