Fixes for context menus

Put functions in more sane place.
Added handleCapture() error message