some basic quick fixes/changes to make more robust