More small fixes - reconciling ever closer with Javascript code