fixed multiple bugs, most notably a missing forward include