Improved framework version check, thanks to Johannes!