Fix bugs & introduce FGL compatibility layer