Test Cases + minor bug fix

-Bug fix found from tests. Quick html output fix.