Updated some code & bug fixes.