fixed line endings & better console messages
fixed type spec for events