bug 507 and small fixes done. Breadcrumps.