fix golden-ratio error
add support for tern