Update beams.lua

minor bug fixes