Was able to compile your code, but I'm wondering if you intentionally have a limit on the values for a as an int. Do you have example EC parameters to test/confirm function?