Got rid of some bugs

Signed-off-by: Charlie <chaz2505@hotmail.com>