Almost working

minor fixes