Fixed some minor bugs with tweaked code?