Fixed buffer problem mentioned in #2.