Bug fixes. Base functionality now in place.