bug fixes - hopefully squahsed.