Added byte array functions.
Various fixes.