Merged some changes from https://silexlab.org into this