Working version

Minor fixes.