Performed misc. cleanup and fixes