Fix some bugs + remove magic numbers