Fixed more bugs with light algo