Removed unnecessary size function; fixed nasty bug in demo mode