Added write-byte primitive. Some fixes.