Fixing autoboxing bug with velocity