     buffer = @_buffer.slice(begin, end)
     @_index -= begin
     @buffer = buffer
-    return @
+    return this
 
   # Slices this buffer
   slice: (begin = 0, end = @length) ->

attr = require('attr-accessor')

class ByteBuffer
  module.exports = @

  # Byte order constants
  @LITTLE_ENDIAN = true
  @BIG_ENDIAN    = false

  # Reference to ByteBuffer
  self = @

  # Shielded utility methods for creating getters/setters on the prototype
  [get, set] = attr.accessors(@)

  # Creates a new ByteBuffer
  # - from given source (assumed to be number of bytes when numeric)

    view.set(@_raw, bytes)
    @_index += bytes
    @buffer = view.buffer
    return this

  # Appends given number of bytes
  append: (bytes) ->
